/* 各表的初始值请根据实际情况稍加修改  */

CREATE SEQUENCE SEQ_SEC_AUTHORITY
    INCREMENT BY 1
    START WITH 457
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_SEC_ORG
    INCREMENT BY 1
    START WITH 221
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_SEC_RESOURCE
    INCREMENT BY 1
    START WITH 458
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_SEC_USER
    INCREMENT BY 1
    START WITH 24
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_CONF_DICTITEM
    INCREMENT BY 1
    START WITH 77
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_CONF_DICTIONARY
    INCREMENT BY 1
    START WITH 25
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_SEC_MENU
    INCREMENT BY 1
    START WITH 67
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_DF_FIELD
    INCREMENT BY 1
    START WITH 1
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_DF_FORM
    INCREMENT BY 1
    START WITH 1
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

CREATE SEQUENCE SEQ_SEC_ROLE
    INCREMENT BY 1
    START WITH 3
    MAXVALUE 9999999999999999999999999999
    NOMINVALUE
    NOCYCLE
    CACHE 20
    NOORDER
GO

/* 对应表的触发器 */


CREATE OR REPLACE TRIGGER TRIGGER_CONF_DICTIONARY  
  before insert on CONF_DICTIONARY    
  for each row 
begin
  select SEQ_CONF_DICTIONARY.nextval into :new.ID from dual;  
end trigger_CONF_DICTIONARY;
GO

CREATE OR REPLACE TRIGGER TRIGGER_CONF_DICTITEM  
  before insert on CONF_DICTITEM    
  for each row 
begin
  select SEQ_CONF_DICTITEM.nextval into :new.ID from dual;  
end trigger_CONF_DICTITEM;
GO

CREATE OR REPLACE TRIGGER TRIGGER_DF_FIELD  
  before insert on DF_FIELD    
  for each row 
begin
  select SEQ_DF_FIELD.nextval into :new.ID from dual;  
end trigger_DF_FIELD;
GO

CREATE OR REPLACE TRIGGER TRIGGER_DF_FORM  
  before insert on DF_FORM    
  for each row 
begin
  select SEQ_DF_FORM.nextval into :new.ID from dual;  
end trigger_DF_FORM;
GO

CREATE OR REPLACE TRIGGER TRIGGER_SEC_AUTHORITY  
  before insert on SEC_AUTHORITY    
  for each row 
begin
  select SEQ_SEC_AUTHORITY.nextval into :new.ID from dual;  
end trigger_SEC_AUTHORITY;
GO

CREATE OR REPLACE TRIGGER TRIGGER_SEC_MENU  
  before insert on SEC_MENU    
  for each row 
begin
  select SEQ_SEC_MENU.nextval into :new.ID from dual;  
end trigger_SEC_MENU;
GO

CREATE OR REPLACE TRIGGER TRIGGER_SEC_ORG  
  before insert on SEC_ORG    
  for each row 
begin
  select SEQ_SEC_ORG.nextval into :new.ID from dual;  
end trigger_SEC_ORG;
GO

CREATE OR REPLACE TRIGGER TRIGGER_SEC_RESOURCE  
  before insert on SEC_RESOURCE    
  for each row
begin
  select SEQ_SEC_RESOURCE.nextval into :new.ID from dual;  
end trigger_SEC_RESOURCE;
GO

CREATE OR REPLACE TRIGGER TRIGGER_SEC_ROLE  
  before insert on SEC_ROLE    
  for each row 
begin
  select SEQ_SEC_ROLE.nextval into :new.ID from dual;  
end trigger_SEC_ROLE;
GO

CREATE OR REPLACE TRIGGER TRIGGER_SEC_USER 
  before insert on SEC_USER    
  for each row 
begin
  select SEQ_SEC_USER.nextval into :new.ID from dual;  
end trigger_SEC_USER;
GO

